package pojo.dto;

import lombok.Getter;
import lombok.Setter;

/**
 * 楼层详细数据类
 */
@Getter
@Setter
public class FloorData {
    private String floorName;
    private int totalNumber;
    private int occupiedNumber;
    private int closedNumber;
    private int freeNumber;

    public FloorData(String floorName, Integer totalNumber, Integer occupiedNumber, Integer closedNumber) {
        this.floorName = floorName;
        if (totalNumber == null)
            this.totalNumber = 0;
        else
            this.totalNumber = totalNumber;
        if (occupiedNumber == null)
            this.occupiedNumber = 0;
        else
            this.occupiedNumber = occupiedNumber;
        if (closedNumber == null)
            this.closedNumber = 0;
        else
            this.closedNumber = closedNumber;

        this.freeNumber = this.totalNumber - this.occupiedNumber - this.closedNumber;
    }

    public FloorData() {
    }

   /* public String getFloorName() {
        return floorName;
    }

    public void setFloorName(String floorName) {
        this.floorName = floorName;
    }

    public int getTotalNumber() {
        return totalNumber;
    }

    public void setTotalNumber(int totalNumber) {
        this.totalNumber = totalNumber;
    }

    public int getOccupiedNumber() {
        return occupiedNumber;
    }

    public void setOccupiedNumber(int occupiedNumber) {
        this.occupiedNumber = occupiedNumber;
    }

    public int getFreeNumber() {
        return freeNumber;
    }

    public void setFreeNumber(int freeNumber) {
        this.freeNumber = freeNumber;
    }

    public int getClosedNumber() {
        return closedNumber;
    }

    public void setClosedNumber(int closedNumber) {
        this.closedNumber = closedNumber;
    }
*/
    @Override
    public String toString() {
        return getFloorName() + "，座位总量" + getTotalNumber() + "，已占用" + getOccupiedNumber() + "剩余" + getFreeNumber();
    }
}
